package com.tn.shirojwt.dao;

import com.tn.shirojwt.bean.Role;
import com.tn.shirojwt.bean.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author lxw
 * @create 2020-03-16  16:22
 **/
public interface RoleDao extends JpaRepository<Role, Long>, JpaSpecificationExecutor<Role> {

    /**
     * 根据用户 获得角色
     */
//    @Query(" select e.role from Role e where e.users=?1 ORDER BY e.role DESC ")
    List<Role> findByUsers(List<String> username);


}
